#include <iostream>//main.cpp
#include "Shape.cpp"

using namespace std;

int main()
{
//  因为Shape是抽象类，我们这里建立其派生类的对象
    TwoDimShape twodim;
    ThreeDimShape threedim;
    TwoDimShape* p2 = &twodim;
    ThreeDimShape* p3 = &threedim;
    Circle circle(4);
    Ellipse ellipse(6,4);
    Rectangle rectangle(10,5);
    Triangle triangle(4,4);
    Ball ball(4);
    Cylinder cylinder(4,6);
    Cuboid cuboid(3,4,5);
    p2 = &circle;
    p2->showData();d
    p2 = &ellipse;
    p2->showData();
    p2 = &rectangle;
    p2->showData();
    p2 = &triangle;
    p2->showData();
    p3 = &ball;
    p3->showData();
    p3 = &cylinder;
    p3->showData();
    p3 = &cuboid;
    p3->showData();

    return 0;
}
